from src.main.server.mapper.impl.server_feedback_impl import ServerFeedbackImpl
from src.main.server.pojo.Result import Result
from src.main.server.utils.feedback_judge import process_data_feedback


class ServerFeedbackController:

    def __init__(self):
        self.impl = ServerFeedbackImpl()

    def all_info(self):
       data = self.impl.all_info()
       result = process_data_feedback(data)
       return result

    def get_info(self, data):
        data = self.impl.get_info(data)
        result = data
        return result

    def update(self, data):
        self.impl.update(data)
        return Result().success()

    def insert(self, data):
        self.impl.insert(data)
        return Result().success()

    def check(self, data):
        """data = (vol_name, server_name)"""
        return self.impl.check(data)


if __name__ == '__main__':
    print(ServerFeedbackController().get_info(("社区服务", "李四")))